package com.acsapp;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;

public class AddPromo extends Activity {

	Context context = this;
	EditText edittext;
	ImageButton add_button;
	ImageButton cancel_button;
	
	 public void onCreate(Bundle savedInstanceState) {
		    super.onCreate(savedInstanceState);
		    
		    setContentView(R.layout.addpromo);
		    edittext = (EditText) findViewById(R.id.edittext);
		    
		    add_button = (ImageButton) findViewById(R.id.add_button1);
		    cancel_button = (ImageButton) findViewById(R.id.cancel_button1);
		    
		    add_button.setOnClickListener(new AddOnClickListner());
		    cancel_button.setOnClickListener(new AddOnClickListner());
	 }


	public class AddOnClickListner implements View.OnClickListener {
		
		@Override
		public void onClick(View arg) {
			// TODO Auto-generated method stub
			if(arg.equals(add_button)){
				//do some adding
				Editable text;
				text = edittext.getText();
				addItems(text);
			}
			else if (arg.equals(cancel_button)){
				//return to menu...
				System.exit(0);
			}
		}
	}

}